With development of network technologies, people are accustomed to mutually sharing data information. Generally, people share data or media content with another terminal in a manner of a multimedia message, an email, or chat software such as QQ and WeChat. Currently, face-to-face users can also complete content sharing by means of an operation between terminals, such as simple touching or shaking. However, before content sharing, how to implement pairing of terminals that are to share content is a relatively tough problem currently.
Currently, there is a terminal pairing method in which hidden data is exchanged by using a near-field communication (NFC) interface. Because a communication distance of the NFC interface is short, it is difficult for a third party to perform interception, and it is more difficult to perform a man-in-the-middle attack, terminal pairing can be completed by using the NFC interface. However, because costs of the NFC interface are relatively high, the solution is not easy to be popularized in various types of terminals.